//
//  RuntimeViewController.m
//  iOSCodeLearning
//
//  Created by TFAppleWork-Summer on 2018/4/11.
//  Copyright © 2018年 Ace. All rights reserved.
//

#import "RuntimeViewController.h"
#import "Person.h"
#import "Woman.h"
@interface RuntimeViewController ()

@end

@implementation RuntimeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    Person *person = [[Person alloc]init];
//    [person addObserver:self forKeyPath:@"name" options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld context:nil];
////    person.name = @"1111";
//    [person setValue:@"2222" forKey:@"name"];
    
    Woman *w = [[Woman alloc]init];
    w.name = @"11";
    
    
}

-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
    
    NSLog(@"keypath:%@",keyPath);
    NSLog(@"change:%@",change);
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
   
}


@end
